package inspire13.duckhuntroid;

import android.graphics.Canvas;
import android.graphics.drawable.Drawable;

public class Grass 
{
	private int mPosX;
	private int mPosY;
	private int mWidth;
	private int mHeight;
	private float mScaleX;
	private float mScaleY;
	
	private Drawable mGrass;
	
	public Grass(Drawable sprite, int posX, int posY, int width, int height)
	{
		mPosX = posX;
		mPosY = posY;
		mWidth = width;
		mHeight = height;
		
		mGrass = sprite;
	}
	
	public void Draw(Canvas canvas)
	{
		int right = (int) ((mPosX + mWidth));
		int bot = (int) ((mPosY + mHeight));
		
		mGrass.setBounds(mPosX, mPosY, right, bot);
		mGrass.draw(canvas);
	}
	
	public void SetScale(float scaleX, float scaleY)
	{
		mScaleX = scaleX;
		mScaleY = scaleY;
		mWidth  = (int)(mWidth * scaleX);
		mHeight = (int)(mHeight * scaleY);
		mPosX  = (int)(mPosX * scaleX);
		mPosY = (int)(mPosY * scaleY);
	}
}
